***************
* Title: gambia_ecd_edcc_dataclean_table5.do
* Author: Todd Pugatch
* Description: replication code for Blimpo, Carneiro, Jervis, and Pugatch,
*	"Improving Access and Quality in Early Childhood Development Programs: 
*		Experimental Evidence from The Gambia"
*	for Economic Development and Cultural Change
* Inputs: ECD_3to6_Gambia_cleanv4.dta
* Outputs: gambia_ecd_sampleprep1.dta
* Notes: creates dataset used for portions of Table 5 in paper
****************
#delimit;
local start=`"$S_TIME"';
clear;
clear matrix;
clear mata;
graph drop _all;
cap log close;
set more off;
/*set directory:
	cd mydir
*/
local data=`"Data\cleaned"';
local output=`"analysis\output"';

* LOAD AND PREPARE DATA;
* first use experimental samples to generate a village-level dataset with dummies for whether village is in 
	ECD Annex or community-based ECD experiment;
* define sample as in gambia_ecd_attrition1.do;
qui use `data'\ECD_3to6_Gambia_cleanv4, clear;
/*NEED TO CHECK TREATMENT STATUS OF SETTLEMENT 37028. DISREGARD FOR NOW*/
qui drop if settlement_code==37028;

* define 3 groups:
	--in baseline
	--in endline (original sample)
	--in endline (newly sampled);
qui gen in_baseline=(ip22!=3 & ip22!=.);	
qui gen in_endline=(interview_result==1);
qui gen in_endline_old=(in_endline==1 & in_baseline==1);
qui gen in_endline_new=(in_endline==1 & in_baseline==0);
/*treat unresolved gender mismatches as new to endline*/
qui replace in_endline_new=1 if in_endline_new==0 & child_gender_mismatch_resolved==0;
qui replace in_endline_old=. if in_endline_new==1;

* repeat for having valid MDAT fine motor and language/hearing scores;
/*note that "in sample" defined as having at least one valid MDAT score, not both as in previous analyses of attrition*/
qui gen in_baseline_mdat=(in_baseline==1 & (fm_baseline_imp0!=.|lh_baseline_imp0!=.));
qui replace in_baseline_mdat=. if in_endline_new==1;
foreach x in endline endline_old endline_new {;
	qui gen in_`x'_mdat=(in_`x'==1 & (fm_endline_imp0!=.|lh_endline_imp0!=.));
};
qui replace in_endline_old_mdat=. if in_endline_new==1;
qui gen in_endline_old_mdat_base=in_endline_old_mdat;
qui replace in_endline_old_mdat_base=. if in_baseline_mdat!=1; /*in baseline MDAT & in endline MDAT*/

* define MDAT complete cases;
foreach w in baseline endline {;
	foreach x in fm lh {;
		qui gen `x'_`w'_complete=(in_`w'_mdat==1 & `x'_`w'_miss==0);
		qui replace `x'_`w'_complete=. if in_`w'_mdat==0;
		lab var `x'_`w'_complete "MDAT `x' module, `w' complete case (no missing items)";
	};
	qui gen mdat_`w'_complete=(fm_`w'_complete==1 & lh_`w'_complete==1);
	qui replace mdat_`w'_complete=. if in_`w'_mdat==0;
	lab var mdat_`w'_complete "MDAT `w', both modules complete case (no missing items)";
};
	
/*keep eligibles*/
* keep if baseline age from 3-6 years, or new to endline;
count; 
keep if (child_age_mths_dob>=36 & child_age_mths_dob<84 & in_baseline==1)|(child_age_mths_dob==. & in_baseline==0);

* keep if new to endline and would have been 3-6 at baseline (define as 4-8 at endline to allow errors);
keep if in_endline_new==0|(in_endline_new==1 & selected_child_age>=48 & selected_child_age<=96 & selected_child_age!=.)|
	(in_endline_new==1 & child_gender_mismatch_resolved==0);
	
* define experimental groups;
qui gen purecontrol=(treatment==1);
qui gen ECDAnnex_control=(treatment==4);
qui gen ECDAnnex_treated=(treatment==5);
qui gen communitybased=(treatment==6);
qui gen ECDAnnex=ECDAnnex_control+ECDAnnex_treated;
qui gen communitybased_all=communitybased+purecontrol;
qui gen experiment=(ECDAnnex==1);
lab def experiment 0 "community-based" 1 "ECD Annex";
lab val experiment experiment;

* NORMALIZE MDAT SCORES: NONPARAMETRIC ADJUSTMENT OF FULL SAMPLE BY AGE AND GENDER, 
	WITH LATER NORMALIZATION BY PURE CONTROL GROUP;
* see gambia_ecd_mdatcheck3.do for discussion of why this method;
* nonparametric estimation follows Pam Jervis procedure for Gambia ECD 0-3 data. 
	For example, see ecd_gambia_ses.do, lines 415-436;
/*IRT scores*/
foreach x in fm lh {;
	foreach w in baseline endline {;
		/*complete cases*/
		/*mean, by age and gender*/
		qui lpoly theta_`x'_`w' child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(mu0) nograph;
		qui lpoly theta_`x'_`w' child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(mu1) nograph;
		qui gen mu=(1-child_female)*mu0 + child_female*mu1;
		/*variance, by age and gender*/
		qui gen r=theta_`x'_`w'-mu; /*residual and its square*/
		qui gen r2=r^2;
		qui lpoly r2 child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(var0) nograph;
		qui lpoly r2 child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(var1) nograph;
		qui gen var=(1-child_female)*var0 + child_female*var1;
		qui gen std = sqrt(var);
		/*preliminary adjustment based on nonparametric model above*/
		qui gen z=(theta_`x'_`w'-mu)/std;
		/*normalize by pure control group*/
		qui su z if purecontrol==1;
		qui gen ztheta_`x'_`w'=(z-r(mean))/r(sd);
		qui replace ztheta_`x'_`w'=. if theta_`x'_`w'==.; /*make sure missing values in proper places*/
		lab var ztheta_`x'_`w' "theta_`x'_`w', age/gender adjusted & normalized to pure control distribution";
		di "normalized distribution for `x', `w' (complete cases)";
		su ztheta_`x'_`w', d;
		tab treatment, su(ztheta_`x'_`w');
		drop mu0 mu1 mu var0 var1 var std r r2 z;
		
		/*imputing 0 or 1 for missing values*/
		forval i=0/1 {;
			/*mean, by age and gender*/
			qui lpoly theta_`x'_`w'_imp`i' child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(mu0) nograph;
			qui lpoly theta_`x'_`w'_imp`i' child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(mu1) nograph;
			qui gen mu=(1-child_female)*mu0 + child_female*mu1;
			/*variance, by age and gender*/
			qui gen r=theta_`x'_`w'_imp`i'-mu; /*residual and its square*/
			qui gen r2=r^2;
			qui lpoly r2 child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(var0) nograph;
			qui lpoly r2 child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(var1) nograph;
			qui gen var=(1-child_female)*var0 + child_female*var1;
			qui gen std = sqrt(var);
			/*preliminary adjustment based on nonparametric model above*/
			qui gen z=(theta_`x'_`w'_imp`i'-mu)/std;
			/*normalize by pure control group*/
			qui su z if purecontrol==1;
			qui gen ztheta_`x'_`w'_imp`i'=(z-r(mean))/r(sd);
			qui replace ztheta_`x'_`w'_imp`i'=. if theta_`x'_`w'_imp`i'==.; /*make sure missing values in proper places*/
			lab var ztheta_`x'_`w'_imp`i' "theta_`x'_`w'_imp`i', age/gender adjusted & normalized to pure control distribution";
			di "normalized distribution for `x', `w' (imputing `i' where missing)";
			su ztheta_`x'_`w'_imp`i', d;
			tab treatment, su(ztheta_`x'_`w'_imp`i');
			drop mu0 mu1 mu var0 var1 var std r r2 z;		
		};
	};
	/*
	/*change from baseline to endline (harder to interpret because these are different tests)*/
	qui gen Dztheta_`x'=ztheta_`x'_endline-ztheta_`x'_baseline;
	qui replace Dztheta_`x'=. if in_endline_mdat==.|in_baseline_mdat==.;
	lab var Dztheta_`x' "ztheta_`x', change between endline & baseline";
	forval i=0/1 {;
		qui gen Dztheta_`x'_imp`i'=ztheta_`x'_endline_imp`i'-ztheta_`x'_baseline_imp`i';
		qui replace Dztheta_`x'_imp`i'=. if in_endline_mdat==.|in_baseline_mdat==.;
		lab var Dztheta_`x'_imp`i' "ztheta`x'_imp`i', change between endline & baseline";	
	};
	*/
};

/*raw scores*/
foreach x in fm lh {;
	foreach w in baseline endline {;
		/*complete cases*/
		/*mean, by age and gender*/
		qui lpoly `x'_`w' child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(mu0) nograph;
		qui lpoly `x'_`w' child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(mu1) nograph;
		qui gen mu=(1-child_female)*mu0 + child_female*mu1;
		/*variance, by age and gender*/
		qui gen r=`x'_`w'-mu; /*residual and its square*/
		qui gen r2=r^2;
		qui lpoly r2 child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(var0) nograph;
		qui lpoly r2 child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(var1) nograph;
		qui gen var=(1-child_female)*var0 + child_female*var1;
		qui gen std = sqrt(var);
		/*preliminary adjustment based on nonparametric model above*/
		qui gen z=(`x'_`w'-mu)/std;
		/*normalize by pure control group*/
		qui su z if purecontrol==1;
		qui gen z`x'_`w'=(z-r(mean))/r(sd);
		qui replace z`x'_`w'=. if `x'_`w'==.; /*make sure missing values in proper places*/
		lab var z`x'_`w' "`x'_`w', age/gender adjusted & normalized to pure control distribution";
		di "normalized distribution for `x', `w' (complete cases)";
		su z`x'_`w', d;
		tab treatment, su(z`x'_`w');
		drop mu0 mu1 mu var0 var1 var std r r2 z;
		
		/*imputing 0 or 1 for missing values*/
		forval i=0/1 {;
			/*mean, by age and gender*/
			qui lpoly `x'_`w'_imp`i' child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(mu0) nograph;
			qui lpoly `x'_`w'_imp`i' child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(mu1) nograph;
			qui gen mu=(1-child_female)*mu0 + child_female*mu1;
			/*variance, by age and gender*/
			qui gen r=`x'_`w'_imp`i'-mu; /*residual and its square*/
			qui gen r2=r^2;
			qui lpoly r2 child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(var0) nograph;
			qui lpoly r2 child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(var1) nograph;
			qui gen var=(1-child_female)*var0 + child_female*var1;
			qui gen std = sqrt(var);
			/*preliminary adjustment based on nonparametric model above*/
			qui gen z=(`x'_`w'_imp`i'-mu)/std;
			/*normalize by pure control group*/
			di "imp`i'";
			su z if purecontrol==1;
			qui gen z`x'_`w'_imp`i'=(z-r(mean))/r(sd);
			qui replace z`x'_`w'_imp`i'=. if `x'_`w'_imp`i'==.; /*make sure missing values in proper places*/
			lab var z`x'_`w'_imp`i' "`x'_`w'_imp`i', age/gender adjusted & normalized to pure control distribution";
			di "normalized distribution for `x', `w' (imputing `i' where missing)";
			su z`x'_`w'_imp`i', d;
			tab treatment, su(z`x'_`w'_imp`i');
			drop mu0 mu1 mu var0 var1 var std r r2 z;		
		};
	};
};

/*raw scores, items common to baseline & endline only*/
* adjust by age and gender, but normalize to baseline scores, to get measures of absolute progress;
foreach x in fm_comm lh_comm {;
	foreach w in baseline endline {;
		/*complete cases*/
		/*mean, by age and gender*/
		qui lpoly `x'_`w' child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(mu0) nograph;
		qui lpoly `x'_`w' child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(mu1) nograph;
		qui gen mu=(1-child_female)*mu0 + child_female*mu1;
		/*variance, by age and gender*/
		qui gen r=`x'_`w'-mu; /*residual and its square*/
		qui gen r2=r^2;
		qui lpoly r2 child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(var0) nograph;
		qui lpoly r2 child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(var1) nograph;
		qui gen var=(1-child_female)*var0 + child_female*var1;
		qui gen std = sqrt(var);
		/*preliminary adjustment based on nonparametric model above*/
		qui gen z=(`x'_`w'-mu)/std;
		/*normalize by pure control group distribution at baseline*/
		if ("`w'"=="baseline") {;
			qui su z if purecontrol==1;
			scalar define mean_`x'=r(mean);
			scalar define sd_`x'=r(sd);
		};
		qui gen z`x'_`w'=(z-mean_`x')/sd_`x';
		qui replace z`x'_`w'=. if `x'_`w'==.; /*make sure missing values in proper places*/
		lab var z`x'_`w' "`x'_`w', age/gender adjusted & normalized to pure control distribution";
		di "normalized distribution for `x', `w' (complete cases)";
		su z`x'_`w', d;
		tab treatment, su(z`x'_`w');
		drop mu0 mu1 mu var0 var1 var std r r2 z;
		
		/*imputing 0 or 1 for missing values*/
		forval i=0/1 {;
			/*mean, by age and gender*/
			qui lpoly `x'_`w'_imp`i' child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(mu0) nograph;
			qui lpoly `x'_`w'_imp`i' child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(mu1) nograph;
			qui gen mu=(1-child_female)*mu0 + child_female*mu1;
			/*variance, by age and gender*/
			qui gen r=`x'_`w'_imp`i'-mu; /*residual and its square*/
			qui gen r2=r^2;
			qui lpoly r2 child_age_yrs_dob if child_female==0, at(child_age_yrs_dob) gen(var0) nograph;
			qui lpoly r2 child_age_yrs_dob if child_female==1, at(child_age_yrs_dob) gen(var1) nograph;
			qui gen var=(1-child_female)*var0 + child_female*var1;
			qui gen std = sqrt(var);
			/*preliminary adjustment based on nonparametric model above*/
			qui gen z=(`x'_`w'_imp`i'-mu)/std;
			/*normalize by pure control group*/
			if ("`w'"=="baseline") {;
				su z if purecontrol==1;
				scalar define mean_`x'_imp`i'=r(mean);
				scalar define sd_`x'_imp`i'=r(sd);				
			};
			qui gen z`x'_`w'_imp`i'=(z-mean_`x'_imp`i')/sd_`x'_imp`i';
			qui replace z`x'_`w'_imp`i'=. if `x'_`w'_imp`i'==.; /*make sure missing values in proper places*/
			lab var z`x'_`w'_imp`i' "`x'_`w'_imp`i', age/gender adjusted & normalized to pure control distribution";
			di "normalized distribution for `x', `w' (imputing `i' where missing)";
			su z`x'_`w'_imp`i', d;
			tab treatment, su(z`x'_`w'_imp`i');
			drop mu0 mu1 mu var0 var1 var std r r2 z;		
		};
	};
	/*change from baseline to endline*/
	qui gen Dz`x'=z`x'_endline-z`x'_baseline;
	qui replace Dz`x'=. if in_endline_mdat==.|in_baseline_mdat==.;
	lab var Dz`x' "z`x', change between endline & baseline";
	forval i=0/1 {;
		qui gen Dz`x'_imp`i'=z`x'_endline_imp`i'-z`x'_baseline_imp`i';
		qui replace Dz`x'_imp`i'=. if in_endline_mdat==.|in_baseline_mdat==.;
		lab var Dz`x'_imp`i' "z`x'_imp`i', change between endline & baseline";	
	};
};

* version of IRT scores top-coded at +/-3 s.d.;
foreach x in fm lh {;
	foreach w in baseline endline {;
		qui gen ztheta_`x'_`w'_tc=ztheta_`x'_`w'_imp0;
		qui replace ztheta_`x'_`w'_tc=3 if ztheta_`x'_`w'_imp0>3 & ztheta_`x'_`w'_imp0!=.;
		qui replace ztheta_`x'_`w'_tc=-3 if ztheta_`x'_`w'_imp0<-3 & ztheta_`x'_`w'_imp0!=.;
		lab var ztheta_`x'_`w'_tc "ztheta_`x'_`w'_imp0, top-coded at +/-3";
	};
};
		
* create wealth quintiles;
drop qwindex*;
xtile qwindex4= wealth4, nq(5);
label var qwindex4 "Quintiles - Wealth Score";
label def qwindex 1 "I (lowest)" 2 "II" 3 "III" 4 "IV" 5 "V (highest)";
label val qwindex4 qwindex;

xtile qwindex5= wealth5, nq(5);
label var qwindex5 "Quintiles - Wealth Score";
label val qwindex5 qwindex;

xtile qwindex6= wealth6, nq(5);
label var qwindex6 "Quintiles - Wealth Score";
label val qwindex6 qwindex;

* dummies for wealth quintiles;
forval i=4/6 {;
	qui tab qwindex`i', gen(qwindex`i'_qnt);
};

* PREPARE DATA FOR HETEROGENEITY ANALYSIS (follows gambia_ecd_results39.do);
/*winsorize annual per-capita expenditure below 1st and above 99th percentiles*/
foreach x in expend_yr_hhpc expend_yr_hhpc_usd {;
	winsor `x', gen(`x'_wins) p(0.01);
};
qui gen ecd_wtppctw_baseline=ecd_wtpq_baseline*12/expend_yr_hhpc_wins;
lab var expend_yr_hhpc_wins "Annual HH expenditure per capita, GMD, winsorized at 1/99 percentiles";
lab var expend_yr_hhpc_usd_wins "Annual HH expenditure per capita, USD, winsorized at 1/99 percentiles";
lab var ecd_wtppctw_baseline "Amount willing to pay for ECD as shr of monthly HH pc expenditure (winsorized) at baseline";

* categories for heterogeneity analysis;
/*simplify names of baseline variables to streamline variable creation*/
local X "ecd_attend ecd_wtppctw vaccinepct child_sick mother_health discsevere_vlnt";
foreach x in `X' {;
	qui gen `x'=`x'_baseline;
};
qui gen stimobjectspct=stimobjectspct_bl;

/*quantiles of baseline HH expenditure, WTP for ECD, asset index (within ECD Annex sample!)*/
foreach x in expend_yr_hhpc_usd_wins ecd_wtppctw pc1 {;
	qui xtile `x'_med=`x', n(2);
	qui xtile `x'_qrt=`x', n(4);
	qui gen `x'_abvmed=(`x'_med==2);
	qui gen `x'_belmed=(`x'_med==1);
	qui tab `x'_qrt, gen(`x'_qrt); /*quartiles: 1=lowest, 4=highest*/
	lab var `x'_abvmed "`x' above median (full sample)";
	lab var `x'_belmed "`x' at or below median (full sample)";
	forval q=1/4 {;
		lab var `x'_qrt`q' "`x' quartile `q' (1=lowest, full sample)";
	};
};

/*baseline MDAT scores and height for age: +/- 0, 1 sd, 2 sd*/
qui gen haz_dob_baseline_imp0=haz_dob_baseline; /*to make code below work*/
foreach x in ztheta_fm ztheta_lh haz_dob {;
	foreach z in pos plus1sd minus1sd plus2sd minus2sd {;
		qui gen `x'_`z'=.;
	};
	qui replace `x'_pos=1 if `x'_baseline_imp0>0 & `x'_baseline_imp0!=.;
	qui replace `x'_pos=0 if `x'_baseline_imp0<=0 & `x'_baseline_imp0!=.;
	qui gen `x'_neg=1-`x'_pos;
	qui replace `x'_plus1sd=1 if `x'_baseline_imp0>1 & `x'_baseline_imp0!=.;
	qui replace `x'_plus1sd=0 if `x'_baseline_imp0<=1 & `x'_baseline_imp0!=.;
	qui replace `x'_minus1sd=1 if `x'_baseline_imp0<-1 & `x'_baseline_imp0!=.;
	qui replace `x'_minus1sd=0 if `x'_baseline_imp0>=-1 & `x'_baseline_imp0!=.;
	qui replace `x'_plus2sd=1 if `x'_baseline_imp0>2 & `x'_baseline_imp0!=.;
	qui replace `x'_plus2sd=0 if `x'_baseline_imp0<=2 & `x'_baseline_imp0!=.;
	qui replace `x'_minus2sd=1 if `x'_baseline_imp0<-2 & `x'_baseline_imp0!=.;
	qui replace `x'_minus2sd=0 if `x'_baseline_imp0>=-2 & `x'_baseline_imp0!=.;
	lab var `x'_pos "`x'_baseline_imp0>0";
	lab var `x'_neg "`x'_baseline_imp0<=0";
	lab var `x'_plus1sd "`x'_baseline_imp0>=1";
	lab var `x'_minus1sd "`x'_baseline_imp0<=-1";
	lab var `x'_plus2sd "`x'_baseline_imp0>=2";
	lab var `x'_minus2sd "`x'_baseline_imp0<=-2";
};
drop haz_dob_baseline_imp0;

/*indicators for above median*/
foreach x in vaccinepct mother_health stimobjectspct discsevere_vlnt wealth6 {;
	qui xtile `x'_med=`x', n(2);
	qui gen `x'_abvmed=(`x'_med==2);
	qui gen `x'_belmed=(`x'_med==1);
	lab var `x'_abvmed "`x' above median (full sample)";
	lab var `x'_belmed "`x' at or below median (full sample)";
};

* create SES index: 1st principal component of wealth, mother's education, and home environment;
/*asset ownership: see gambia_ecd_clean1.do*/
forval i=1/11 {;
	qui gen alt_s5q14_`i'=s5q14_`i';
	qui replace alt_s5q14_`i'=0 if s5q14_`i'==2;
};
forval i=1/7 {;
	qui gen alt_s5q15_`i'=s5q15_`i';
	qui replace alt_s5q15_`i'=0 if s5q15_`i'==2;
};
forval i=1/5 {;
	qui gen alt_s5q16_`i'=s5q16_`i';
	qui replace alt_s5q16_`i'=0 if s5q16_`i'==2;
};
forval i=1/2 {;
	qui gen alt_s5q17_`i'=s5q17_`i';
	qui replace alt_s5q17_`i'=0 if s5q17_`i'==2;
};
order alt_s5q14* alt_s5q15* alt_s5q16* alt_s5q17*; 
local X "alt_s5q14_1-alt_s5q17_2 mother_schl_yrs stimobjectscount_bl stimplaycount_bl";
qui pca `X';
qui predict ses;
drop alt*;
lab var ses "SES (1st principal component of wealth, mother's schooling, and home environment)";

* categories for heterogeneity analysis;
/*quantiles of baseline SES*/
foreach x in ses {;
	qui xtile `x'_med=`x', n(2);
	qui xtile `x'_qnt=`x', n(5);
	qui gen `x'_abvmed=(`x'_med==2);
	qui gen `x'_belmed=(`x'_med==1);
	qui tab `x'_qnt, gen(`x'_qnt); /*quintiles: 1=lowest, 5=highest*/
	lab var `x'_abvmed "`x' above median (full sample)";
	lab var `x'_belmed "`x' at or below median (full sample)";
	forval q=1/5 {;
		lab var `x'_qnt`q' "`x' quintile `q' (1=lowest)";
	};
};
drop *_med;

* sample sizes (# of children and project sites);
qui egen site=tag(settlement_code);
table treatment, c(freq rawsum site);
drop site;

* save data for later analysis;
qui compress;
lab data "Gambia ECD 3-6 data, analysis sample from gambia_ecd_sampleprep1.do";
qui save `data'\gambia_ecd_sampleprep1, replace;

local end=`"$S_TIME"'; 
di "`start'";
di "`end'";
